<!DOCTYPE html>
<html lang=en

  >

  <head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
    <meta name="description" content="TOP 1：谈谈你对Spring的理解？ 主要是为了简化企业级应用的后台开发，降低耦合性。平时接触到最多的还是IoC和AOP两个特性。IoC指的是控制反转，把对象的创建和依赖关系的维护交给Spring容器去管理。 Spring 通过工厂模式、反射机制等技术管理对象的作用域和生命周期。AoP一般称为面向切面编程，是面向对象的一种补充，将程序中独立于其他功能的方法抽取出来，使Java开发模块化，仅需专">
<meta property="og:type" content="article">
<meta property="og:title" content="Spring">
<meta property="og:url" content="https://liushuaijun.gitee.io/mrl/2023/09/05/spring/index.html">
<meta property="og:site_name" content="一个有温度的小流年">
<meta property="og:description" content="TOP 1：谈谈你对Spring的理解？ 主要是为了简化企业级应用的后台开发，降低耦合性。平时接触到最多的还是IoC和AOP两个特性。IoC指的是控制反转，把对象的创建和依赖关系的维护交给Spring容器去管理。 Spring 通过工厂模式、反射机制等技术管理对象的作用域和生命周期。AoP一般称为面向切面编程，是面向对象的一种补充，将程序中独立于其他功能的方法抽取出来，使Java开发模块化，仅需专">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2023-09-05T09:31:58.000Z">
<meta property="article:modified_time" content="2023-09-05T09:33:43.205Z">
<meta property="article:author" content="小流年">
<meta name="twitter:card" content="summary">
    
    
      
        
          <link rel="shortcut icon" href="/mrl/images/favicon.ico">
        
      
      
        
          <link rel="icon" type="image/png" href="/mrl/images/favicon-192x192.png" sizes="192x192">
        
      
      
        
          <link rel="apple-touch-icon" sizes="180x180" href="/mrl/images/apple-touch-icon.png">
        
      
    
    <!-- title -->
    <title>Spring</title>
    <!-- async scripts -->
    <!-- Google Analytics -->


    <!-- Umami Analytics -->


    <!-- styles -->
    
<link rel="stylesheet" href="/mrl/css/style.css">

    <!-- persian styles -->
    
    <!-- rss -->
    
    
	<!-- mathjax -->
	
<meta name="generator" content="Hexo 6.3.0"></head>


    <body class="max-width mx-auto px3 ltr">
      
        <div id="header-post">
  <a id="menu-icon" href="#" aria-label="Menu"><i class="fa-solid fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#" aria-label="Menu"><i class="fa-solid fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" aria-label="Top" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fa-solid fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
        <!--
       --><li><a href="/mrl/search/">搜索</a></li><!--
     --><!--
       --><li><a href="/mrl/">首页</a></li><!--
     --><!--
       --><li><a href="/mrl/categories/">个人</a></li><!--
     --><!--
       --><li><a href="/mrl/articles/">归档</a></li><!--
     --><!--
       --><li><a href="/mrl/product/">产品</a></li><!--
     -->
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        
        <li><a class="icon" aria-label="Next post" href="/mrl/2023/09/05/%E5%AF%B9SPA%E5%8D%95%E9%A1%B5%E9%9D%A2%E7%9A%84%E7%90%86%E8%A7%A3/"><i class="fa-solid fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" aria-label="Back to top" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fa-solid fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" aria-label="مشاركة المنشور" href="#"><i class="fa-solid fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">Previous post</span>
      <span id="i-next" class="info" style="display:none;">Next post</span>
      <span id="i-top" class="info" style="display:none;">Back to top</span>
      <span id="i-share" class="info" style="display:none;">مشاركة المنشور</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" target="_blank" rel="noopener" href="http://www.facebook.com/sharer.php?u=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="https://twitter.com/share?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&text=Spring"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://www.linkedin.com/shareArticle?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="https://pinterest.com/pin/create/bookmarklet/?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&is_video=false&description=Spring"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=Spring&body=Check out this article: https://liushuaijun.gitee.io/mrl/2023/09/05/spring/"><i class="fa-solid fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="https://getpocket.com/save?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://reddit.com/submit?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://www.stumbleupon.com/submit?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://digg.com/submit?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://www.tumblr.com/share/link?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&name=Spring&description="><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="https://news.ycombinator.com/submitlink?u=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&t=Spring"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    
    
      <div id="toc">
        <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#TOP-1%EF%BC%9A%E8%B0%88%E8%B0%88%E4%BD%A0%E5%AF%B9Spring%E7%9A%84%E7%90%86%E8%A7%A3%EF%BC%9F"><span class="toc-number">1.</span> <span class="toc-text">TOP 1：谈谈你对Spring的理解？</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-2-%EF%BC%9A%E4%BB%80%E4%B9%88%E6%98%AF%E4%BA%8B%E5%8A%A1"><span class="toc-number">2.</span> <span class="toc-text">Top 2 ：什么是事务</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-2-1-%EF%BC%9A%E4%BA%8B%E5%8A%A1%E7%9A%84%E5%AE%9E%E7%8E%B0%E6%96%B9%E5%BC%8F"><span class="toc-number">3.</span> <span class="toc-text">Top 2.1 ：事务的实现方式</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-3-%EF%BC%9A%E4%BD%BF%E7%94%A8-Transactional-%E5%A4%B1%E6%95%88%E5%9C%BA%E6%99%AF"><span class="toc-number">4.</span> <span class="toc-text">Top 3 ：使用@Transactional 失效场景</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-3-1-%EF%BC%9A-Transactional%E6%B3%A8%E6%9C%89%E5%93%AA%E4%BA%9B%E5%B1%9E%E6%80%A7%EF%BC%9F"><span class="toc-number">5.</span> <span class="toc-text">Top 3.1 ：@Transactional注有哪些属性？</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-4-%EF%BC%9ASpirng-%E5%B8%B8%E7%94%A8%E6%B3%A8%E8%A7%A3"><span class="toc-number">6.</span> <span class="toc-text">Top 4 ：Spirng 常用注解</span></a></li></ol>
      </div>
    
  </span>
</div>

          
            <div class="content index py4 ">
              
                    <article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle p-name" itemprop="name headline">
        Spring
    </h1>



    <div class="meta">
      <span class="author p-author h-card" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span class="p-name" itemprop="name">小流年</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2023-09-05T09:31:58.000Z" class="dt-published" itemprop="datePublished">2023-09-05</time>
        
      
    </div>


      
    <div class="article-category">
        <i class="fa-solid fa-archive"></i>
        <a class="category-link" href="/mrl/categories/Spring/">Spring</a>
    </div>


      

    </div>
  </header>
  

  <div class="content e-content" itemprop="articleBody">
    <h1 id="TOP-1：谈谈你对Spring的理解？"><a href="#TOP-1：谈谈你对Spring的理解？" class="headerlink" title="TOP 1：谈谈你对Spring的理解？"></a>TOP 1：谈谈你对Spring的理解？</h1><ul>
<li>主要是为了简化企业级应用的后台开发，降低耦合性。平时接触到最多的还是IoC和AOP两个特性。IoC指的是控制反转，把对象的创建和依赖关系的维护交给Spring容器去管理。</li>
<li>Spring 通过工厂模式、反射机制等技术管理对象的作用域和生命周期。AoP一般称为面向切面编程，是面向对象的一种补充，将程序中独立于其他功能的方法抽取出来，使Java开发模块化，仅需专注于主业务即可</li>
</ul>
<h1 id="Top-2-：什么是事务"><a href="#Top-2-：什么是事务" class="headerlink" title="Top 2 ：什么是事务"></a>Top 2 ：什么是事务</h1><ul>
<li>Spring事务是指在Spring框架中对于数据库操作的一种支持，它通过对一组数据库操作进行整体控制来保证数据的一致性和完整性。Spring事务可以保证在一组数据库操作执行时，要么所有操作都执行成功，要么所有操作都回滚到之前的状态，从而避免了数据不一致的情况。</li>
</ul>
<h1 id="Top-2-1-：事务的实现方式"><a href="#Top-2-1-：事务的实现方式" class="headerlink" title="Top 2.1 ：事务的实现方式"></a>Top 2.1 ：事务的实现方式</h1><ul>
<li><p>1.Spring事务可以通过编程式事务和声明式事务两种方式来实现。编程式事务需要在代码中手动控制事务的开始、提交和回滚等操作，</p>
</li>
<li><p>2.而声明式事务则是通过在配置文件中声明事务的切入点和通知等信息来自动控制事务的行为。</p>
</li>
<li><p>编程式事务实现</p>
  <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line">@RestController</span><br><span class="line">@RequestMapping(&quot;/user&quot;)</span><br><span class="line">public class UserController &#123;</span><br><span class="line"></span><br><span class="line">    @Autowired</span><br><span class="line">    private UserService userService;</span><br><span class="line"></span><br><span class="line">    // 编程式事务</span><br><span class="line">    @Autowired</span><br><span class="line">    private DataSourceTransactionManager transactionManager; // 事务管理器</span><br><span class="line"></span><br><span class="line">    @Autowired</span><br><span class="line">    private TransactionDefinition transactionDefinition; // 定义事务属性</span><br><span class="line"></span><br><span class="line">    @RequestMapping(&quot;/del&quot;)</span><br><span class="line">    public int del(Integer id) &#123;</span><br><span class="line"></span><br><span class="line">        if (id == null || id &lt;= 0) return 0;</span><br><span class="line"></span><br><span class="line">        TransactionStatus transactionStatus = null;</span><br><span class="line">        int result = 0;</span><br><span class="line"></span><br><span class="line">        try &#123;</span><br><span class="line"></span><br><span class="line">            // 1. 开启事务</span><br><span class="line">            // 传入 transactionDefinition 给事务管理器 transactionManager 创建一个 transactionStatus 事务</span><br><span class="line">            transactionStatus = transactionManager.getTransaction(transactionDefinition);</span><br><span class="line"></span><br><span class="line">            result = userService.del(id);</span><br><span class="line">            System.out.println(&quot;删除 : &quot; + result + &quot; 条数据&quot;);</span><br><span class="line"></span><br><span class="line">            // 2. 事务提交</span><br><span class="line">            transactionManager.commit(transactionStatus);</span><br><span class="line"></span><br><span class="line">        &#125; catch (Exception e) &#123;</span><br><span class="line">            // 事务对象正常</span><br><span class="line">            if (transactionStatus != null) &#123;</span><br><span class="line">                transactionManager.rollback(transactionStatus); // 事务回滚</span><br><span class="line">            &#125;</span><br><span class="line">            return 0;</span><br><span class="line">        &#125;</span><br><span class="line">        return result;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure></li>
<li><p>可以看到, 这个代码里, 当我们访问路由方法时, 如果出现了异常主动进行回滚, 正常执行则提交事务.<br>在 try 语句块中主动构建算数异常 : int a &#x3D; 10 &#x2F; 0; 加入到上述代码中, 执行路由方法观察是否进行回滚, 访问路由方法, 传入 id &#x3D; 1</p>
</li>
<li><p>声明式事务</p>
</li>
<li><p>@Transactional</p>
</li>
</ul>
<h1 id="Top-3-：使用-Transactional-失效场景"><a href="#Top-3-：使用-Transactional-失效场景" class="headerlink" title="Top 3 ：使用@Transactional 失效场景"></a>Top 3 ：使用@Transactional 失效场景</h1><ul>
<li><p>@Transactional 可以作用在接口、类、类方法。</p>
</li>
<li><p>作用于类：当把@Transactional 注解放在类上时，表示所有该类的public方法都配置相同的事务属性信息。</p>
</li>
<li><p>作用于方法：当类配置了@Transactional，方法也配置了@Transactional，方法的事务会覆盖类的事务配置信息。</p>
</li>
<li><p>作用于接口：不推荐这种使用方法，因为一旦标注在Interface上并且配置了Spring AOP 使用CGLib动态代理，将会导致@Transactional注解失效</p>
</li>
</ul>
<h1 id="Top-3-1-：-Transactional注有哪些属性？"><a href="#Top-3-1-：-Transactional注有哪些属性？" class="headerlink" title="Top 3.1 ：@Transactional注有哪些属性？"></a>Top 3.1 ：@Transactional注有哪些属性？</h1><p>propagation属性</p>
<ol>
<li>propagation 代表事务的传播行为，默认值为 Propagation.REQUIRED，其他的属性信息如下：</li>
<li></li>
<li>Propagation.REQUIRED：如果当前存在事务，则加入该事务，如果当前不存在事务，则创建一个新的事务。( 也就是说如果A方法和B方法都添加了注解，在默认传播模式下，A方法内部调用B方法，会把两个方法的事务合并为一个事务 ）</li>
<li>Propagation.SUPPORTS：如果当前存在事务，则加入该事务；如果当前不存在事务，则以非事务的方式继续运行。</li>
<li>Propagation.MANDATORY：如果当前存在事务，则加入该事务；如果当前不存在事务，则抛出异常。</li>
<li>Propagation.REQUIRES_NEW：重新创建一个新的事务，如果当前存在事务，暂停当前的事务。( 当类A中的 a 方法用默认Propagation.REQUIRED模式，类B中的 b方法加上采用 Propagation.REQUIRES_NEW模式，然后在 a 方法中调用 b方法操作数据库，然而 a方法抛出异常后，b方法并没有进行回滚，因为Propagation.REQUIRES_NEW会暂停 a方法的事务 )</li>
<li>Propagation.NOT_SUPPORTED：以非事务的方式运行，如果当前存在事务，暂停当前的事务。</li>
<li>Propagation.NEVER：以非事务的方式运行，如果当前存在事务，则抛出异常。</li>
<li>Propagation.NESTED ：和 Propagation.REQUIRED 效果一样。</li>
<li>isolation 属性</li>
<li></li>
<li>isolation ：事务的隔离级别，默认值为 Isolation.DEFAULT。</li>
<li></li>
<li>Isolation.DEFAULT：使用底层数据库默认的隔离级别。</li>
<li>Isolation.READ_UNCOMMITTED</li>
<li>Isolation.READ_COMMITTED</li>
<li>Isolation.REPEATABLE_READ</li>
<li>Isolation.SERIALIZABLE</li>
<li>timeout 属性</li>
<li></li>
<li>timeout ：事务的超时时间，默认值为 -1。如果超过该时间限制但事务还没有完成，则自动回滚事务。</li>
<li></li>
<li>readOnly 属性</li>
<li></li>
<li>readOnly ：指定事务是否为只读事务，默认值为 false；为了忽略那些不需要事务的方法，比如读取数据，可以设置 read-only 为 true。</li>
<li></li>
<li>rollbackFor 属性</li>
<li></li>
<li>rollbackFor ：用于指定能够触发事务回滚的异常类型，可以指定多个异常类型。</li>
</ol>
<h1 id="Top-4-：Spirng-常用注解"><a href="#Top-4-：Spirng-常用注解" class="headerlink" title="Top 4 ：Spirng 常用注解"></a>Top 4 ：Spirng 常用注解</h1><ul>
<li>1.声明bean的注解</li>
<li></li>
<li>@Component 组件，没有明确的角色</li>
<li></li>
<li>@Service 在业务逻辑层使用（service层）</li>
<li></li>
<li>@Repository 在数据访问层使用（dao层）</li>
<li></li>
<li>@Controller 在展现层使用，控制器的声明（C）</li>
<li></li>
<li>2.注入bean的注解</li>
<li></li>
<li>@Autowired：由Spring提供</li>
<li></li>
<li>@Inject：由JSR-330提供</li>
<li></li>
<li>@Resource：由JSR-250提供</li>
</ul>

  </div>
</article>



                      
                        <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
        
          <li><a href="/mrl/search/">搜索</a></li>
        
          <li><a href="/mrl/">首页</a></li>
        
          <li><a href="/mrl/categories/">个人</a></li>
        
          <li><a href="/mrl/articles/">归档</a></li>
        
          <li><a href="/mrl/product/">产品</a></li>
        
      </ul>
    </div>

    
    
      <div id="toc-footer" style="display: none">
        <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#TOP-1%EF%BC%9A%E8%B0%88%E8%B0%88%E4%BD%A0%E5%AF%B9Spring%E7%9A%84%E7%90%86%E8%A7%A3%EF%BC%9F"><span class="toc-number">1.</span> <span class="toc-text">TOP 1：谈谈你对Spring的理解？</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-2-%EF%BC%9A%E4%BB%80%E4%B9%88%E6%98%AF%E4%BA%8B%E5%8A%A1"><span class="toc-number">2.</span> <span class="toc-text">Top 2 ：什么是事务</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-2-1-%EF%BC%9A%E4%BA%8B%E5%8A%A1%E7%9A%84%E5%AE%9E%E7%8E%B0%E6%96%B9%E5%BC%8F"><span class="toc-number">3.</span> <span class="toc-text">Top 2.1 ：事务的实现方式</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-3-%EF%BC%9A%E4%BD%BF%E7%94%A8-Transactional-%E5%A4%B1%E6%95%88%E5%9C%BA%E6%99%AF"><span class="toc-number">4.</span> <span class="toc-text">Top 3 ：使用@Transactional 失效场景</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-3-1-%EF%BC%9A-Transactional%E6%B3%A8%E6%9C%89%E5%93%AA%E4%BA%9B%E5%B1%9E%E6%80%A7%EF%BC%9F"><span class="toc-number">5.</span> <span class="toc-text">Top 3.1 ：@Transactional注有哪些属性？</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Top-4-%EF%BC%9ASpirng-%E5%B8%B8%E7%94%A8%E6%B3%A8%E8%A7%A3"><span class="toc-number">6.</span> <span class="toc-text">Top 4 ：Spirng 常用注解</span></a></li></ol>
      </div>
    

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" target="_blank" rel="noopener" href="http://www.facebook.com/sharer.php?u=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="https://twitter.com/share?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&text=Spring"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://www.linkedin.com/shareArticle?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="https://pinterest.com/pin/create/bookmarklet/?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&is_video=false&description=Spring"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=Spring&body=Check out this article: https://liushuaijun.gitee.io/mrl/2023/09/05/spring/"><i class="fa-solid fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="https://getpocket.com/save?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://reddit.com/submit?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://www.stumbleupon.com/submit?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://digg.com/submit?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&title=Spring"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="http://www.tumblr.com/share/link?url=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&name=Spring&description="><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" target="_blank" rel="noopener" href="https://news.ycombinator.com/submitlink?u=https://liushuaijun.gitee.io/mrl/2023/09/05/spring/&t=Spring"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fa-solid fa-bars fa-lg" aria-hidden="true"></i> Menu</a>
        
          <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fa-solid fa-list fa-lg" aria-hidden="true"></i> TOC</a>
        
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fa-solid fa-share-alt fa-lg" aria-hidden="true"></i> Share</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fa-solid fa-chevron-up fa-lg" aria-hidden="true"></i> Top</a>
    </div>

  </div>
</div>

                          
                            <footer id="footer">
  <div class="footer-left">
    Copyright &copy;
    
    
    2020-2023
    小流年
  </div>
  <div class="footer-right">
    <nav>
      <ul>
        <!--
       --><li><a href="/mrl/search/">搜索</a></li><!--
     --><!--
       --><li><a href="/mrl/">首页</a></li><!--
     --><!--
       --><li><a href="/mrl/categories/">个人</a></li><!--
     --><!--
       --><li><a href="/mrl/articles/">归档</a></li><!--
     --><!--
       --><li><a href="/mrl/product/">产品</a></li><!--
     -->
      </ul>
    </nav>
  </div>
  
  <div class="busuanzi">
    
      <!-- 不蒜子统计 -->
      <span id="busuanzi_container_site_pv">
        网站总访问量:<span id="busuanzi_value_site_pv"></span>
      </span>
      
     <span class="post-meta-divider">|</span>
      <span id="busuanzi_container_site_uv" style='display:none'>
          本站访客数<span id="busuanzi_value_site_uv"></span>人
      </span>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
     
  </div>
</footer>

            </div>
            <!-- styles -->



  <link rel="preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" crossorigin="anonymous" onload="this.onload=null;this.rel='stylesheet'"/>


              <!-- jquery -->

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" crossorigin="anonymous"></script>




<!-- clipboard -->

  
    <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.7/clipboard.min.js" crossorigin="anonymous"></script>
  
  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"Copy to clipboard!\">";
    btn += '<i class="fa-regular fa-clone"></i>';
    btn += '</span>';
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "Copied!");
      e.clearSelection();
    })
  })
  </script>


<script src="/mrl/js/main.js"></script>

<!-- search -->

<!-- Baidu Analytics -->

<!-- Cloudflare Analytics -->

<!-- Disqus Comments -->

<!-- utterances Comments -->

    </body>

    </html>